package https

import (
	"net/http"
	"time"
)

// GET请求
//
//	uri		请求地址
//	param	请求参数
//	header	请求头，自动追加accept、Content-Type等属性
func Get(uri string, param, header map[string]string) *CURL {
	header = getHeader(header)
	curl := CURL{
		Uri:       uri,
		Param:     param,
		Header:    header,
		StartTime: time.Now(),
	}
	defer questLogFunc(&curl)
	req, err := http.NewRequest("GET", getParam(uri, param), nil)
	if err != nil {
		curl.Error = err
		return &curl
	}
	return curl.queryBody(req)
}
